<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>24-jQuery事件绑定</title>
    <script src="./js/jquery-1.12.4.js"></script>
    <script>
      $(function(){
          var $btn = $('button')
        //   2种方式绑定click事件，两个事件不会被覆盖,都将执行
          $btn.click(function(){
            //   console.log('ldh')
            alert('ldh')
          })
          $btn.on("click",function(){
            //   console.log('ldh')
            alert('lyf')
          })
        // 指向事件mouseenter
          $btn.mouseenter(function(){
              alert('你好')
          })
          $btn.on("mouseleave",function(){
              alert("再见")
          })
        })
    </script>
</head>
<body>
    <button>我是按钮</button>
</body>
</html>